package org.pjlib.common;

import android.content.Context;

import com.umeng.analytics.MobclickAgent;
import com.umeng.commonsdk.UMConfigure;

/**
 * Created by ws on 2018/09/06.
 */

public class UMengUtils {
    public static void init(Context ctx,String appKey) {
        UMConfigure.init(ctx, appKey, "umeng", UMConfigure.DEVICE_TYPE_PHONE, "");//58edcfeb310c93091c000be2 5965ee00734be40b580001a0
        UMConfigure.setLogEnabled(false);
        MobclickAgent.setCatchUncaughtExceptions(true);
        MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO);
    }
    public static void reportError(Context context, String error){
        MobclickAgent.reportError(context,error);
    }
    //或
    public static void reportError(Context context, Throwable e){
        MobclickAgent.reportError(context,e);
    }
    public static void onPageStart(String viewName){
        MobclickAgent.onPageStart(viewName);
    }
    public static void onPageEnd(String viewName){
        MobclickAgent.onPageEnd(viewName);
    }
    public static void onResume(Context context){
        MobclickAgent.onResume(context);
    }
    public static void onPause(Context context){
        MobclickAgent.onPause(context);
    }
}
